package com.example.academic_affairs_system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.academic_affairs_system.mapper.provider.AasStudentCoursesProvider;
import com.example.academic_affairs_system.model.entity.AasStudentCourses;
import com.example.academic_affairs_system.model.vo.studentCourses.StudentCoursesVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * 学生和课表的关联数据，用于登记学生的课程成绩 Mapper 接口
 *
 * @author hjx
 * @since 2023-01-31
 */
public interface AasStudentCoursesMapper extends BaseMapper<AasStudentCourses> {
  @SelectProvider(value = AasStudentCoursesProvider.class, method = "getClassStudentCourses")
  List<StudentCoursesVO> getClassStudentCourses(
      IPage<StudentCoursesVO> page,
      @Param("coursesId") long coursesId,
      @Param("classId") long classId);

  @SelectProvider(value = AasStudentCoursesProvider.class, method = "getStudentCourses")
  List<StudentCoursesVO> getStudentCourses(
      IPage<StudentCoursesVO> page, @Param("studentId") long studentId);
}
